package com.java.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class User {
    private int        id;
    private String     name;
    private String     phone;
    private String     password;
    private Timestamp  regtime;
    private Timestamp  logintime;
    private int        status;
    private String     email;

    public User() {}

    public User(String name, String phone, String password, Timestamp regtime, String email) {
        this.name = name;
        this.phone = phone;
        this.password = password;
        this.regtime = regtime;
        this.email = email;
    }

    public User(String name, String phone, String password, Timestamp regtime, Timestamp logintime, String email) {
        this.name = name;
        this.phone = phone;
        this.password = password;
        this.regtime = regtime;
        this.logintime = logintime;
        this.email = email;
    }

    public User(int id, String name, String phone, String password, Timestamp regtime, Timestamp logintime, int status, String email) {
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.password = password;
        this.regtime = regtime;
        this.logintime = logintime;
        this.status = status;
        this.email = email;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Timestamp getRegtime() {
        return regtime;
    }

    public void setRegtime(Timestamp regtime) {
        this.regtime = regtime;
    }

    public Timestamp getLogintime() {
        return logintime;
    }

    public void setLogintime(Timestamp logintime) {
        this.logintime = logintime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id == user.id && status == user.status && Objects.equals(name, user.name) && Objects.equals(phone, user.phone) && Objects.equals(password, user.password) && Objects.equals(regtime, user.regtime) && Objects.equals(logintime, user.logintime) && Objects.equals(email, user.email);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, phone, password, regtime, logintime, status, email);
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", password='" + password + '\'' +
                ", regtime=" + regtime +
                ", logintime=" + logintime +
                ", status=" + status +
                ", email='" + email + '\'' +
                '}';
    }
}
